<?php

/**
 *
 * @author Zsolt Lengyel
 *
 */
class m130220_233000_registration extends CDbMigration{


   public function up(){

      $this->createTable('registration', array(
              'id' => 'pk',
              'type'=> "VARCHAR(10) NOT NULL",
              'firstname' => "VARCHAR(255) NOT NULL",
              'lastname'=> "VARCHAR(255) NOT NULL",
              'email' => "VARCHAR(255) NOT NULL",
              'phone' => "VARCHAR(255) NOT NULL",
              'birthDate'=> "datetime DEFAULT NULL",
              'birthPlace'=> "VARCHAR(255) DEFAULT NULL",
              'studies' => "TEXT DEFAULT NULL",
              'musics' => "TEXT DEFAULT NULL",
              'results' => "TEXT DEFAULT NULL",
              'created' => "datetime NOT NULL",
              'modified' => "datetime NOT NULL",
              'valid' => 'tinyint(1) NOT NULL DEFAULT \'1\'',
      ));
      $this->createIndex('unique_email', 'registration', 'email', true);

   }

   public function down(){

      $this->dropTable('registration');

   }


}